using Microsoft.Xna.Framework;

namespace GameFrameworkLibraly.Helpers.GeometryHelpers
{
    public struct RectangleWithFloats
    {
        public float X;
        public float Y;
        public float Width;
        public float Height;

        public float Top
        {
            get { return Y; }
        }

        public float Bottom
        {
            get { return Y + Height; }
        }

        public float Left
        {
            get { return X; }
        }

        public float Right
        {
            get { return X + Width; }
        }

        public Point Center
        {
            get{return new Point((int) (X+Width/2),(int) (Y+Height/2));}
        }

        public Rectangle Rectangle
        {
            get{return new Rectangle((int) X,(int) Y,(int) Width,(int) Height);}
        }

        public void Offset(float x, float y)
        {
            X += x;
            Y += y;
        }


        public RectangleWithFloats(float x, float y, float width, float height)
        {
            X = x;
            Height = height;
            Width = width;
            Y = y;
        }

        public RectangleWithFloats(Rectangle rectangle)
        {
            X = rectangle.X;
            Height = rectangle.Height;
            Width = rectangle.Width;
            Y = rectangle.Y;
        }
    }
}
